#include "bit_util.h"

uint16_t set_bit_16(uint16_t chomp, unsigned int bitNum) {
    return chomp | (1 << bitNum);
}

uint16_t clear_bit_16(uint16_t chomp, unsigned int bitNum) {
    return chomp & ~(1 << bitNum);
}

uint16_t set_bit_value_16(uint16_t chomp, unsigned int bitNum, unsigned int value) {
    if (value) {
        return set_bit_16(chomp, bitNum);
    } else {
        return clear_bit_16(chomp, bitNum);
    }
}

unsigned int get_bit_value_16(uint16_t chomp, unsigned int bitNum) {
    if (chomp & (1 << bitNum)) {
        return 1;
    } else {
        return 0;
    }
}
